package com.ccc3gc.mysystem.service.impl;

import com.ccc3gc.mysystem.bean.Authentication;
import com.ccc3gc.mysystem.mapper.AuthenticationMapper;
import com.ccc3gc.mysystem.service.AuthenticationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AuthenticationServiceImpl implements AuthenticationService {
    @Autowired
    public AuthenticationMapper authenticationMapper;

    /**
     * @return authentications
     */
    @Override
    public List<Authentication> selectAuthenticationList(Authentication authentication) {
        List<Authentication> authentications = authenticationMapper.selectAuthentication(authentication);
        return authentications;
    }

    /**根据Id查询认证信息
     * @param authId
     * @return
     */
    @Override
    public Authentication queryAuthentication(int authId) {
        Authentication authentication = authenticationMapper.queryAuthentication(authId);
        return authentication;
    }

    /**
     * @param authentication
     * @return
     */
    @Override
    public int instertAuthentication(Authentication authentication) {
        int rows = authenticationMapper.insterAuthentication(authentication);
        return rows;
    }

    /**
     * @param authentication
     * @return
     */
    @Override
    public int updateAuthentication(Authentication authentication) {
        int rows = authenticationMapper.updateAuthentication(authentication);
        return rows;
    }

    /**
     * @param authenticationId
     * @return
     */
    @Override
    public int deleteAuthenticationById(int authenticationId) {
        int rows = authenticationMapper.deleteAuthenticationById(authenticationId);
        return rows;
    }

    /**
     * @param authenticationIds
     * @return
     */
    @Override
    public int deleteAuthenticationByIds(List<Integer> authenticationIds) {
        int rows = authenticationMapper.deleteAuthenticationByIds(authenticationIds);
        return rows;
    }

}
